//    Copyright 2008,2009 Paul Jorgensen
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#pragma once
#include "pComboBox.h"

//class pf_ParseString:public CpComboBoxApp
class pf_ParseString
{
public:
	CString TokenResultFinal[20];
	CString TokenStrings_SlashP[30];
	CString TokenStrings_SlashT[30];
	

private:
	BOOL SlashPSet;
	BOOL SlashTSet;
	BOOL SlashWSet;
	BOOL SlashHSet;
	int pi_SlashPTotal;
	int pi_ErrorLevel;
	int pi_NumTotalTokensFound;
	BOOL pg_SlashPTotalError;
	char pcArgChar;              // the default is slash, but functions will be setup to set it to a different char
	CString psToken[30];     // stores the tokens found
	int piCurTokensFound;  // total of tokens found in class functions
	
	

public:
	pf_ParseString(void);
	~pf_ParseString(void);

	int pf_ParseString::pf_OOPDispatch(CString ps_TokenParam);

	int fParseCommandline_pComboxBox(CDialog* pparam_dlg);
	int pf_FindArgChar(CString psCmdlineParam,int piStrParsePosCopy, int piStrLenCopy);
	//int pf_RetrieveQuotedString(CString ps_CmdlineParam,int piStrParsePosCopy, int piStrLenCopy, CString *psTokenParam, int piCurTokensFoundParam);
	int pf_ParseString::pf_RetrieveQuotedStringTwo(CString psCmdlineParam,int piStrParsePosCopy, int piStrLenCopy, int piCurTokensFoundParam);
	int pf_CmdDispatch(CString ps_TokenParam);
	int pf_Process_SlashP(CString ps_TokenParam);
	int pf_Process_SlashH(CString ps_TokenParam);
	int pf_Process_SlashW(CString ps_TokenParam);
	int pf_Process_SlashT(CString ps_TokenParam);
	int pf_Process_SlashB(CString ps_TokenParam);
	BOOL pf_GetSlashPSet(void);
	BOOL pf_GetSlashTSet(void);
	BOOL pf_GetSlashWSet(void);
	void pf_SetSlashPSet(BOOL SetSlashPParam);
	void pf_SetSlashTSet(BOOL SetSlashTParam);
	void pf_SetSlashWSet(BOOL SetSlashWParam);

	// a function to parse tokens in a CString
	int pf_ParseTokens(wchar_t * pchp_StringToParse);
	CString pf_GetToken(int TokenNumber);
	int GetTokenTotal(void);
	int pf_Getpi_SlashPTotal(void);
	int pf_Setpi_SlashPTotal(int SetSlashPTotal);
	int pf_Getpi_ErrorLevel(void);
	void pf_Setpi_ErrorLevel(int Setpi_ErrorLevel);
	int pf_Getpi_NumTotalTokensFound(void);
	void pf_Setpi_NumTotalTokensFound(int Setpi_NumTotalTokensFound);
	void pf_Setpg_SlashPTotalError(BOOL Setpg_SlashPTotalError);
	BOOL pf_Getpg_SlashPTotalError(void);
	int pf_WriteResultRegistryItem(CString ps_ResultString);
};
